package com.ruoyi.rulengine.listener;



import com.ruoyi.rulengine.service.IRuleEngineService;
import jakarta.annotation.Resource;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Service;
import com.ruoyi.iotcommon.constant.RocketTopicConstant;
import com.ruoyi.iotcommon.domain.DeviceDataMessage;


/**
 * 设备上报数据监听器
 */
@Service
@RocketMQMessageListener( topic = RocketTopicConstant.DEVICE_DATA, consumerGroup = "iot-rulengine-device-data")
public class DeviceDataListener implements RocketMQListener<DeviceDataMessage>{

    @Resource
    private IRuleEngineService ruleEngineService;


    @Override
    public void onMessage(DeviceDataMessage deviceData) {

        ruleEngineService.getRules(deviceData);
    }
    
}
